import Vue from 'vue'
import Vuex from 'vuex'
import state from './city.js'
import mutations from './mutations.js'
Vue.use(Vuex)


export default new Vuex.Store({
  state,
  actions: {
    cityChange(ctx, cityName){
      //在这里做具体的操作，或者先执行异步函数，数据满足条件后再对数据操作
      ctx.commit('cityChange', cityName)
    }
  },
  mutations
})
